package me.tuyou.aop.bean;

import me.tuyou.aop.annotation.MyLog;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author tuyou_cd
 * @Date 2020/5/28 14:16
 */
@Component
public class MyBean {

    @MyLog
    public void test(String name, int age) {
        System.out.println("test method, name:" + name + ", age:" + age);
        test2();  //这种方式不会使用代理
//        ((MyBean)(AopContext.currentProxy())).test2();
    }

    public void test2() {
        System.out.println("test method2");
    }
}
